#include <iostream>
#include<stdio.h>
#include<algorithm>
#include <math.h>
#include<string>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		string s1, s2;
		cin >> s1 >> s2;
		sort(s1.begin(), s1.end());
		sort(s2.begin(), s2.end());
		if (s1 == s2)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}
	return 0;
}